﻿using System;
using System.Collections.Generic;

using System.Text;

namespace QQZiFramework
{
    /// <summary>
    /// 可显示在客户端的异常
    /// </summary>
    public class ClientException : Exception
    {
        public ClientException(string message) : base(message) { }

        public ClientException(string message, Exception inner) : base(message, inner) { }
    }


    public class NotLoginException : ClientException
    {

        public NotLoginException() : base("您没有登录") { }

    }
    public class NotMerchantExcepton : ClientException
    {
        public NotMerchantExcepton() : base("商家账号未开通，请先申请，若已提交申请，请等待审核！") { }
    }

    public class PasswordErrorException : ClientException
    {
        public int UserId { get; set; }
        public PasswordErrorException(int userId) : base("密码错误!")
        {
            this.UserId = userId;
        }

    }

    public class NotAlowAccessException : ClientException
    {
        public NotAlowAccessException() : base("禁止访问！") { }


        public NotAlowAccessException(string msg) : base("禁止访问：" + msg) { }

    }
    public class VerifyCodeTimeOutException : ClientException
    {
        public VerifyCodeTimeOutException() : base("验证码已超时！") { }
    }


    public class FormatSourceNoFoundException : ClientException
    {
        public FormatSourceNoFoundException(string key) : base(key + "在DBContext的FormatSource中不存，请检查是否有添加。") { }
    }

    public class ServerBusyException : ClientException
    {
        public ServerBusyException() : base("服务器繁忙，请再试一次！") { }
    }

    public class ConfigurationEmptyException : Exception
    {
        public ConfigurationEmptyException() { }
        public ConfigurationEmptyException(string item) : base(item + "没有配置") { }

    }

}
